package org.binglan.youziyuepai.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.binglan.youziyuepai.entity.*;
import com.baomidou.mybatisplus.extension.service.IService;
import org.binglan.youziyuepai.enums.code.AllowEnum;
import org.binglan.youziyuepai.vo.ActivityVo;
import org.binglan.youziyuepai.vo.PageVo;

import java.util.List;

/**
 * <p>
 * 活动表 服务类
 * </p>
 *
 * @author sanjin
 * @since 2019-04-09
 */
public interface ActivityService extends IService<Activity> {

    /**
     * 保存活动
     * @param activityToOccupationList 活动所需人员职业以及人数
     * @param activityToImageList 活动场地图片
     * @param activity 活动信息
     * @return
     */
    Boolean saveActivity(List<ActivityToOccupation> activityToOccupationList, List<ActivityToImage> activityToImageList, Activity activity);

    /**
     * id 查询
     * @return
     */
    ActivityVo queryActivityVoById(Integer id);

    /**
     * id 查询
     * @return
     */
    Activity queryActivityById(Integer id);

    /**
     * 删除活动
     * @param activityId
     * @return
     */
    boolean deleteActivityByActivityId(Integer activityId, String userId);

    /**
     * 用户参加活动
     * @return
     */
    boolean addUserToActivity(String userId, Integer activityId, Integer occupationId);

    /**
     * 用户退出活动
     * @param userId
     * @param activityId
     * @return
     */
    boolean quitUserToActivity(String userId, Integer activityId);

    /**
     * 分页查询活动视图对象
     * @param page
     * @param isAllow
     * @return
     */
    PageVo<ActivityVo> queryActivityVoByPage(Page<Activity> page, Integer isAllow);

    /**
     * 查询数量
     * @param isAllow
     * @return
     */
    long queryCount(Integer isAllow);

    /**
     * 获取用户已经参加的活动
     * @param userId
     * @return
     */
    List<ActivityVo> getUserJoinActivitys(String userId);
}
